<!-- 收货方扫描签收的图片确认列表 -->
<template>
  <div class="gridContainer">
    <div class="m-det-warp mb30">
      <div class="m-det-tit">{{data.SaleCorpName}}</div>
      <div class="m-det-list">
        <ul class="m-det-ul">
          <li class="displayflex">
            <span class="label">送货清单数：</span>
            <div class="flex1 value"><em>{{data.shOrdercount}}</em></div>
          </li>
          <li class="displayflex">
            <span class="label">取货清单数：</span>
            <div class="flex1 value"><em>{{data.qhOrdercount}}</em></div>
          </li>
          <li class="displayflex">
            <span class="label">联系人：</span>
            <div class="flex1 value">{{data.SendContacts}} {{data.SendContactsTel}}</div>
          </li>
          <li class="displayflex">
            <span class="label">地址：</span>
            <div class="flex1 value">{{data.ArrivalAddress}}</div>
          </li>
        </ul>
      </div>
    </div>

    <div class="m-form-wrap">

      <div class="m-form-box">
        <span class="txt">退货件数</span>
        <div class="m-form-ipt">
          <input type="number"
                 placeholder="请输入退货件数"
                 v-model="thCount" />
        </div>
      </div>
      <div class="m-form-box">
        <span class="txt">周转箱件数</span>
        <div class="m-form-ipt">
          <input type="number"
                 placeholder="请输入周转箱件数"
                 v-model="zzCount" />
        </div>
      </div>

    </div>
    <div class="w100fix"></div>
    <div class="checknum-bot displayflex">
      <div class="flex1">
        <ul class="cf cn-btn-grp f-r">
          <li class="btn-checknum f-l cancel"
              @click="backLink()">取消</li>
          <li class="btn-checknum f-l"
              @click="Confirm()">确认</li>
        </ul>
      </div>
    </div>
  </div>
</template>


<script>
import uploader from '@/components/share/imageUploader/imageUploader.vue';

export default {
  components: {
    uploader,
  },
  data () {
    return {
      reasonList: [
        ['请选择']
      ],
      data: [],
      goodslist: [],
      imgseize: 0,
      imgList: [],
      imgListBd: [],
      guid: "",
      Memo: "",
      ReceiverID: "",
      ReceiverName: "",
      PRContactsTel: "",
      thCount: '',
      zzCount: '',
      totalNum: 0,
      checkedName: "",
      reason: [],
      curHos: "",
      Carrierlist: [],
      showHos: false,
      signName: '',
    };
  },
  computed: {
    userinfo () {
      return localStorage.userinfo ? JSON.parse(localStorage.userinfo) : null;
    }
  },
  created () {
    this.getData();
  },
  methods: {
    onChange (value) {
      this.reason = value;
    },

    getData () {
      this.data = JSON.parse(this.$route.query.item);
      console.log(this.$route.query.item);
    },
    change (val) {
      this.imgseize = val;
    },
    Confirm () {
      var query = {
        Guid: this.data.Guid,
        SaleCorpGUID: this.data.SaleCorpGUID,
        SaleCorpName: this.data.SaleCorpName,
        ArrivalAddress: this.data.ArrivalAddress,
        Receiver: this.userinfo.StaffID,
        ReceiverName: this.userinfo.Name,
        thCount: this.thCount,
        zzCount: this.zzCount
      };

      this.Ajax.post("HandoverConfirmBack", query).then((res) => {
        if (res.IsSuccess) {
          this.$router.go(-1);
          this.$vux.toast.show({
            text: '带回确认成功',
            type: 'success',
            time: 1000,
            onHide () {
              //location.reload();
            }
          });
        } else {
          this.Toast({
            message: res.ErrorMessage || "出错了，请刷新重试",
          });
        }
      }).catch(e => {
        console.log(e);
        this.Toast({
          message: '出错了，请刷新重试',
        });
      });
    },



    backLink () {
      this.$router.push({
        path: '/driver/cardeliverygrup'
      })
    }
  },
};
</script>